//
//  MJ_ReportOpenTableViewCell.m
//  UEAssistant
//
//  Created by mac on 2018/1/8.
//  Copyright © 2018年 youyixinxi. All rights reserved.
//

#import "MJ_ReportOpenTableViewCell.h"
#import "UIColor+Extend.h"

@interface MJ_ReportOpenTableViewCell ()

@property (strong, nonatomic)NSMutableArray *contentArray;

@end

@implementation MJ_ReportOpenTableViewCell


- (NSMutableArray *)contentArray {
    if (!_contentArray) {
        _contentArray = [NSMutableArray array];
    }
    return _contentArray;
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        self.separatorInset = UIEdgeInsetsZero;
        
        NSArray *titles = @[@"非译去重",@"文件去重",@"共享语料"];
        for (NSInteger i = 0; i < 3; ++ i) {
            
            UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(15+i%4*((Screen_Width-30)/4.0), 15+i/4*64, (Screen_Width-30)/4.0, 15)];
            titleLabel.text = titles[i];
            titleLabel.textColor = [UIColor colorWithHexString:@"#999999"];
            titleLabel.font = [UIFont systemFontOfSize:12];
            
            UILabel *contentLabel = [[UILabel alloc] initWithFrame:CGRectMake(15+i%4*((Screen_Width-30)/4.0), 36+i/4*64, (Screen_Width-30)/4.0, 20)];
            contentLabel.text = [NSString stringWithFormat:@"%zd",i];
            contentLabel.textColor = [UIColor colorWithHexString:@"#333333"];
            contentLabel.font = [UIFont systemFontOfSize:15];
            
            [self.contentArray addObject:contentLabel];
            
            [self.contentView addSubview:titleLabel];
            [self.contentView addSubview:contentLabel];
        }
    }
    return self;
}

- (void)setOpenModel:(MJReportListModel *)openModel {
    _openModel = openModel;
    NSArray *content = @[openModel.no_wordcount,
                         openModel.dup_wordcount,
                         openModel.sharepre_wordcount];
    if (self.contentArray.count == 3) {
        NSInteger index = 0;
        for (UILabel *label in self.contentArray) {
            label.text = content[index];
            index ++;
        }
    }
        

}

@end
